﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Windows.ApplicationModel.Activation;

namespace Throw_In
{
    public partial class Splash : PhoneApplicationPage
    {
        DateTime startTime, elapsed;
        public Splash()
        {
            InitializeComponent();
            
            this.Loaded += new RoutedEventHandler(Default_Loaded); 
        }

        private void Default_Loaded(object sender, RoutedEventArgs e){

            this.NavigationService.Navigate(new Uri("/Home.xaml", System.UriKind.RelativeOrAbsolute));
        }
        private async void calculate()
        {
            elapsed = DateTime.Now;
            TimeSpan span = elapsed.Subtract(startTime);
            System.Diagnostics.Debug.WriteLine(span.Seconds);
            if (span.Seconds < 3)
            {
                calculate();
            }
            else
                this.NavigationService.Navigate(new Uri("/Home.xaml", System.UriKind.RelativeOrAbsolute));
        }
    }
}